package command;

import command.command.DoorOffCommand;
import command.command.DoorOnCommand;
import command.command.LightOffCommand;
import command.command.LightOnCommand;
import command.entity.Door;
import command.entity.Light;

/**
 * @author 帅小伙
 * @date 2022/1/12
 * @description
 */
public class Client {

    public static void main(String[] args) {
        Light light = new Light();
        LightOnCommand lightOnCommand = new LightOnCommand(light);
        LightOffCommand lightOffCommand = new LightOffCommand(light);
        Door door = new Door();
        DoorOnCommand doorOnCommand = new DoorOnCommand(door);
        DoorOffCommand doorOffCommand = new DoorOffCommand(door);

        Controller controller = new Controller();
        controller.setCommand(0,lightOnCommand,lightOffCommand);
        controller.setCommand(1,doorOnCommand,doorOffCommand);
        controller.on(1);
        controller.on(0);
        controller.rollBack();

    }
}
